//package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.util.regex.Pattern;

public class MasterTestConsumer extends SeleneseTestCase {
	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.gfwfn.com/");
		selenium.start();
	}

	@Test
	public void testUntitled16() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		selenium.open("/CustomerThankyou.php");
		selenium.type("id=txtFriend1Name", "Tester 1");
		selenium.type("id=txtFriend2Name", "Tester 2");
		selenium.type("id=txtFriend3Name", "Tester 3");
		selenium.type("id=txtFriend4Name", "Tester 4");
		selenium.type("id=txtFriend1Email", "thoward@xperience-det.com");
		selenium.type("id=txtFriend2Email", "thoward2@xperience-det.com");
		selenium.type("id=txtFriend3Email", "thoward3@xperience-det.com");
		selenium.type("id=txtFriend4Email", "thoward4@xperience-det.com");
		
		}
	
	@Test
	public void testUntitled() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		selenium.open("/CustomerThankyou.php");
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=h2"));
		verifyTrue(selenium.isTextPresent("CONGRATULATIONS John Thompson"));
		verifyTrue(selenium.isTextPresent("You are now registered for GO FURTHER WITH FORD NIGHT at Test Dealership."));
		verifyTrue(selenium.isElementPresent("css=p"));
		verifyTrue(selenium.isElementPresent("css=strong"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[2]"));
		verifyTrue(selenium.isElementPresent("css=h3"));
		verifyTrue(selenium.isElementPresent("css=label.w120"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[4]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[5]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[6]/label"));
		verifyTrue(selenium.isElementPresent("css=label.w140"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[4]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[5]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1e']/p[6]/label[2]"));
		verifyTrue(selenium.isElementPresent("css=a[name=\"fb_share\"] > img"));
		verifyTrue(selenium.isElementPresent("css=a.twitter-share-button > img"));
		verifyTrue(selenium.isElementPresent("link=Click here"));
		verifyTrue(selenium.isElementPresent("css=#regForm > p"));
		verifyTrue(selenium.isTextPresent("Click here to go to Random Acts of Fusion"));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("css=p.alignLeft.aiDisclaimer"));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
		selenium.click("css=img[alt=\"Check out the all-new 2013 Fusion\"]");
	}
	
	@Test
	public void testUntitled3() throws Exception {
		selenium.open("http://www.gofurtherwithfordnight2.com/");
		selenium.click("css=img.slider");
	}
	
	
	@Test
	public void testConHomePage() throws Exception {
		selenium.open("http://www.gofurtherwithfordnight2.com");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
		selenium.click("css=img[alt=\"Check out the all-new 2013 Fusion\"]");
	}
	
	@Test
	public void testUntitled5() throws Exception {
		selenium.open("/");
		verifyTrue(selenium.isTextPresent(""));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Get into the act!\"]"));
		verifyTrue(selenium.isTextPresent("www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("xpath=(//img[@alt='Register now for a chance to win a trip to see a live taping of American Idol®!*'])[2]"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Get into the act!\"]"));
		verifyTrue(selenium.isElementPresent("//img[@alt='Join us and your participating Ford Dealership will make a donation to charity.*']"));
		verifyTrue(selenium.isElementPresent("//img[@alt='Attend this one-time event and you may win a 2013 Fusion!*']"));
		verifyTrue(selenium.isElementPresent("xpath=(//img[@alt='Register now for a chance to win a trip to see a live taping of American Idol®!*'])[2]"));
		verifyTrue(selenium.isElementPresent("//img[@alt='Test Your Judging Skills with American Idol® and you could win a VIP prize package*']"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Enroll\"]"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("css=p.alignRight"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isTextPresent("www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("xpath=(//img[@alt='Register now for a chance to win a trip to see a live taping of American Idol®!*'])[2]"));
		}

	@Test
	public void testuntitled6() throws Exception {
		selenium.open("http://www.gofurtherwithfordnight2.com/ZipCodeLookup.php");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
		selenium.click("css=img[alt=\"Check out the all-new 2013 Fusion\"]");
	}
	
	@Test
	public void testuntitled() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
}
	@Test
	public void testuntitled7() throws Exception {
		selenium.open("http://www.gofurtherwithfordnight2.com/ZipCodeLookup.php");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=strong"));
		verifyTrue(selenium.isElementPresent("link=Test Dealership"));
		verifyTrue(selenium.isElementPresent("id=carBlocker"));
		verifyTrue(selenium.isElementPresent("id=cons1c"));
		verifyTrue(selenium.isElementPresent("id=content"));
		verifyTrue(selenium.isElementPresent("link=Test Dealership"));
		verifyTrue(selenium.isTextPresent("Test Dealership\n123 Test Street\n Testertown, CA 01234"));
		verifyTrue(selenium.isTextPresent("Test Dealership\n123 Test Street\n Testertown, CA 01234"));
		verifyTrue(selenium.isTextPresent("CHOOSE THE FORD DEALERSHIP YOU WOULD LIKE TO VISIT!"));
		verifyTrue(selenium.isTextPresent("OR I have a preferred dealer not listed here:"));
		verifyTrue(selenium.isTextPresent("Dealership Name (Required)"));
		verifyTrue(selenium.isTextPresent("City where dealer is located (Required)"));
		verifyTrue(selenium.isElementPresent("id=txtPrefDealerName"));
		verifyTrue(selenium.isElementPresent("id=txtPrefDealerCity"));
		verifyTrue(selenium.isElementPresent("id=prefDealerSubmit"));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isTextPresent("American Idol ®/© 19 TV Ltd. and FremantleMedia North America. 2013 All Rights Reserved. www.americanidol.com\nCharitable donations are the sole responsibility of Ford, not American Idol® or related parties."));
	}
	
	@Test
	public void testUntitled9() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		selenium.open("/Registration.php?ID=994f06ea-91e5-49d9-8864-1e0c5949b3e8&dn=VGVzdCBEZWFsZXJzaGlw");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 9 fields. They have been highlighted below"));
		selenium.type("id=txtFirstName", "Thomas");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 8 fields. They have been highlighted below"));
		selenium.type("id=txtLastName", "Thompson");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 7 fields. They have been highlighted below"));
		selenium.type("id=txtAddress", "1 American Road");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 6 fields. They have been highlighted below"));
		selenium.type("id=txtCity", "Dearborn");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 5 fields. They have been highlighted below"));
		selenium.select("id=selState", "label=Michigan");
		selenium.click("css=option[value=\"MI\"]");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 4 fields. They have been highlighted below"));
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 3 fields. They have been highlighted below"));
		selenium.type("name=txtEmail", "thomasjohn@net.net");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 2 fields. They have been highlighted below"));
		selenium.click("name=submit");
		selenium.click("id=cbOver18");
		selenium.click("name=submit");
		verifyTrue(selenium.isTextPresent("You missed 1 field. It has been highlighted below"));
		selenium.click("id=cbRules");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
		
		}
	
	@Test
	public void testUntitled11() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isElementPresent("id=header"));
		verifyTrue(selenium.isTextPresent("EVENT REGISTRATION"));
		verifyTrue(selenium.isElementPresent("css=strong"));
		verifyTrue(selenium.isTextPresent("exact:Please complete the form below to register for Go Further with Ford Night and be entered for a chance to win a trip including two tickets to see American Idol®!**"));
		verifyTrue(selenium.isElementPresent("css=p"));
		verifyTrue(selenium.isElementPresent("link=win a trip"));
		verifyTrue(selenium.isElementPresent("css=label.w80"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[3]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[4]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[5]/label"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[2]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[2]/label[3]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[3]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[4]/label[3]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[4]/label[2]"));
		verifyTrue(selenium.isElementPresent("//div[@id='cons1d']/p[5]/label[2]"));
		verifyTrue(selenium.isElementPresent("id=txtEmailLabel"));
		verifyTrue(selenium.isElementPresent("css=div.cbGroup > p.clearFix > label"));
		verifyTrue(selenium.isTextPresent("YES! Please email me communications including product information, offers, incentives and surveys from Ford Motor Company and the local dealer."));
		verifyTrue(selenium.isElementPresent("id=cbMarketingOptIn"));
		verifyTrue(selenium.isElementPresent("id=cbOver18"));
		verifyTrue(selenium.isElementPresent("css=div.cbGroup"));
		verifyTrue(selenium.isElementPresent("id=cbRules"));
		verifyTrue(selenium.isElementPresent("css=div.cbGroup"));
		verifyTrue(selenium.isElementPresent("css=p.bottomRight"));
		verifyTrue(selenium.isTextPresent("exact:*Required\n **See full official rules for details."));
		verifyTrue(selenium.isTextPresent("exact:*Required\n **See full official rules for details."));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("css=p.alignLeft.aiDisclaimer"));
		verifyTrue(selenium.isTextPresent("American Idol ®/© 19 TV Ltd. and FremantleMedia North America. 2013 All Rights Reserved. www.americanidol.com\nCharitable donations are the sole responsibility of Ford, not American Idol® or related parties."));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
		verifyTrue(selenium.isTextPresent("exact:First Name:*"));
		verifyTrue(selenium.isTextPresent("exact:Address:*"));
		verifyTrue(selenium.isTextPresent("exact:City*:"));
		verifyTrue(selenium.isTextPresent("Home Phone:"));
		verifyTrue(selenium.isTextPresent("M.I.:"));
		verifyTrue(selenium.isTextPresent("exact:Last Name:*"));
		verifyTrue(selenium.isTextPresent("exact:Apartment:"));
		verifyTrue(selenium.isTextPresent("exact:State*:"));
		verifyTrue(selenium.isTextPresent("exact:Zip Code*:"));
		verifyTrue(selenium.isTextPresent("Cell Phone:"));
		verifyTrue(selenium.isTextPresent("exact:Email:*"));
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
		selenium.click("css=img[alt=\"Check out the all-new 2013 Fusion\"]");
		
		}

	@Test
	public void testUntitled12() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("60000");
		selenium.click("link=Test Dealership");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtFirstName", "Tester");
		selenium.type("id=txtMiddleInitial", "T");
		selenium.type("id=txtLastName", "Tester112");
		selenium.type("id=txtAddress", "1 American Road");
		selenium.type("id=txtAppartment", "11");
		selenium.type("id=txtCity", "Dearborn");
		selenium.select("id=selState", "label=Michigan");
		selenium.type("id=txtZip", "01234");
		selenium.type("name=txtEmail", "johntest12@live.com");
		selenium.click("id=cbMarketingOptIn");
		selenium.click("id=cbOver18");
		selenium.click("id=cbRules");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
	}
	
	@Test
	public void testuntitiled13() throws Exception {
		selenium.open("http://www.gofurtherwithfordnight2.com/ZipCodeLookup.php");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=www.americanidol.com");
		selenium.click("link=Official Rules");
		selenium.click("link=Privacy Statement");
		selenium.click("link=CA Privacy Statement");
		selenium.click("css=img[alt=\"Check out the all-new 2013 Fusion\"]");
	}

	@Test
	public void testUntitled14() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		selenium.type("id=txtZip", "01234");
		selenium.type("id=txtRadius", "10");
		selenium.click("name=submit");
		selenium.waitForPageToLoad("30000");
	}
	
	@Test
	public void testUntitled15() throws Exception {
		selenium.open("/");
		selenium.click("css=img[alt=\"Enroll\"]");
		selenium.waitForPageToLoad("30000");
		verifyTrue(selenium.isElementPresent("css=img[alt=\"Check out the all-new 2013 Fusion\"]"));
		verifyTrue(selenium.isTextPresent("Go Further With Ford Night"));
		verifyTrue(selenium.isTextPresent("Enter your zip code:"));
		verifyTrue(selenium.isTextPresent("Search radius (miles):"));
		verifyTrue(selenium.isElementPresent("id=txtZip"));
		verifyTrue(selenium.isElementPresent("id=txtRadius"));
		verifyTrue(selenium.isElementPresent("name=submit"));
		verifyTrue(selenium.isElementPresent("link=www.americanidol.com"));
		verifyTrue(selenium.isElementPresent("link=Official Rules"));
		verifyTrue(selenium.isElementPresent("link=Privacy Statement"));
		verifyTrue(selenium.isElementPresent("link=CA Privacy Statement"));
	}
	
	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
